import request from '@/utils/request'

// 查询货位列表
export function listGoods(query) {
  return request({
    url: '/equipment/goods/list',
    method: 'get',
    params: query
  })
}
export function listGoodsNoSelect(query) {
  return request({
    url: '/equipment/goods/listNoSelectS',
    method: 'get',
    params: query
  })
}
// 查询货位详细
export function getGoods(id) {
  return request({
    url: '/equipment/goods/' + id,
    method: 'get'
  })
}
// 查询货位详细
export function newQrCode(id) {
  return request({
    url: '/equipment/goods/newQrCode/' + id,
    method: 'get'
  })
}
// 新增货位
export function addGoods(data) {
  return request({
    url: '/equipment/goods',
    method: 'post',
    data: data
  })
}

// 修改货位
export function updateGoods(data) {
  return request({
    url: '/equipment/goods',
    method: 'put',
    data: data
  })
}

// 删除货位
export function delGoods(id) {
  return request({
    url: '/equipment/goods/' + id,
    method: 'delete'
  })
}
// 获取所有的子级库位
export function listDepotByAncestors(id) {
  return request({
    url: '/equipment/goods/listDepot/' + id,
    method: 'get'
  })
}
export function allRefreshQr(){
  return request({
    url: '/equipment/goods/allRefreshQr',
    method: 'get',
    timeout: 60000
  })
}
